<!--
 * @Description: In User Settings Edit
 * @Author: your name
 * @Date: 2019-09-04 16:18:08
 * @LastEditTime: 2019-09-11 16:12:29
 * @LastEditors: Please set LastEditors
 -->
<template>
  <view class="slects">
        <view class="ler_one">温馨提示，请根据需要收集的作业，选择对应的学科</view>
        <view class="ler_two">
            <view v-for="(item,index) in datay" @click="gopic(index+1)" :key="index"><image :src="item.img" @click="toQuestion(index+1)"></image>{{item.course}}</view>
        </view>
  </view>
</template>

<script>
const util = require('../../utils/util.js')
const apis = require('../../utils/api.js').default
export default {
      data(){
            return {
                  datay:[
                        {course:'数学',img:'/static/images/shu.png'},
                        {course:'语文',img:'/static/images/yu.png'},
                        {course:'英语',img:'/static/images/ying.png'},
                        {course:'化学',img:'/static/images/hua.png'},
                        {course:'物理',img:'/static/images/wy.png'}
                  ],
                  grade:0
            }
      },
  onLoad(options){
        console.log(options)
        this.$set(this,'grade',options.grade)
  },
  methods:{
    gopic:function(num){
      // wx.navigateTo({
      //   url:"../picture/main?type="+num
      // })
    },
    toQuestion(classIndex){
          console.log(classIndex)
          wx.navigateTo({
                url:`/pages/question/main?grader=${this.grade}&classIndex=${classIndex}`
          })
    }
  }
}
</script>

<style lang="less" scoped>
.slects{
      width: 100%;
      height: 100%;
}
.slects .ler_one{
      font-size: 28rpx;
      color: #070707;
      margin:82rpx 0 30rpx 0;
      text-align: center;
}
.slects .ler_two{
      width: 70%;
      margin: 0 auto;
}
.slects .ler_two view{
      display: inline-block;
      text-align: center;
      font-size: 32rpx;
      color: #919191;
}
.slects .ler_two view:nth-child(3n-1){
      margin: 0 85rpx 75rpx 85rpx;
}
.slects .ler_two view image{
      width: 118rpx;
      height: 118rpx;
      display: block;
      margin-bottom: 48rpx;
}
.slects image{
      width:95%;
      height: 392rpx; 
      display: block;
      margin: 0 auto;
}

</style>

